import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_draw/p11/pic_man.dart';

import 'curve_box.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  // 横屏显示
  SystemChrome.setPreferredOrientations(
      [DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);
  // 全屏显示
  SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
  //runApp(MyApp());
  runApp(const PicManApp());
}

class PicManApp extends StatelessWidget {
  const PicManApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'PicMan',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const Scaffold(
          body: Center(
        child: PicMan(),
      )),
    );
  }
}

class MyApp extends StatelessWidget {
  final curvesMap = {
    "linear": Curves.linear,
    "decelerate": Curves.decelerate,
    "fastLinearToSlowEaseIn": Curves.fastLinearToSlowEaseIn,
    "ease": Curves.ease,
    "easeIn": Curves.easeIn,
    "easeInToLinear": Curves.easeInToLinear,
    "easeInSine": Curves.easeInSine,
    "easeInQuad": Curves.easeInCubic,
    "easeInCubic": Curves.easeInCubic,
    "easeInQuart": Curves.easeInQuart,
    "easeInQuint": Curves.easeInQuint,
    "easeInExpo": Curves.easeInExpo,
    "easeInCirc": Curves.easeInCirc,
    "easeInBack": Curves.easeInBack,
    "easeOut": Curves.easeOut,
    "linearToEaseOut": Curves.linearToEaseOut,
    "easeOutSine": Curves.easeOutSine,
    "easeOutQuad": Curves.easeOutQuad,
    "easeOutCubic": Curves.easeOutCubic,
    "easeOutQuart": Curves.easeOutQuart,
    "easeOutQuint": Curves.easeOutQuint,

    // "easeOutExpo": Curves.easeOutExpo,
    // "easeOutCirc": Curves.easeOutCirc,
    // "easeOutBack": Curves.easeOutBack,
    // "easeInOut": Curves.easeInOut,
    // "easeInOutSine": Curves.easeInOutSine,
    // "easeInOutQuad": Curves.easeInOutQuad,
    // "easeInOutCubic": Curves.easeInOutCubic,
    // "easeInOutQuart": Curves.easeInOutQuart,
    // "easeInOutQuint": Curves.easeInOutQuint,
    // "easeInOutExpo": Curves.easeInOutExpo,
    // "easeInOutCirc": Curves.easeInOutCirc,
    // "easeInOutBack": Curves.easeInOutBack,
    // "fastOutSlowIn": Curves.fastOutSlowIn,
    // "slowMiddle": Curves.slowMiddle,
    // "bounceIn": Curves.bounceIn,
    // "bounceOut": Curves.bounceOut,
    // "bounceInOut": Curves.bounceInOut,
    // "elasticIn": Curves.elasticIn,
    // "elasticInOut": Curves.elasticInOut,
    // "elasticOut": Curves.elasticOut,
  };

  MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'PicMan',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Scaffold(
        body: Wrap(
          runSpacing: 10,
          children: curvesMap.keys
              .map((e) => Column(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      CurveBox(curve: curvesMap[e]!),
                      const SizedBox(height: 3),
                      Text(e, style: const TextStyle(fontSize: 10))
                    ],
                  ))
              .toList(),
        ),
      ),
    );
  }
}
